/** 
 * @file 1.构造析构顺序.cpp
 * @author 18-工程视觉-黄星照
 * @brief 阅读下列代码，回答代码是否能通过编译，
 *            如可以，请回答代码的输出；
 *            如不行，请回答编译器报错原因，并修改，然后回答代码输出。
 * @date 2020-09-25
 */
#include <iostream>

/**
 * 
 * 可以
 * A constructor.
 * B constructor.
 * C constructor.
 * C destructor.
 * B destructor.
 * A destructor.
 */
class A
{
public:
    A()
    {
        ::std::cout << "A constructor.\n";
    }
    ~A()
    {
        ::std::cout << "A destructor.\n";
    }
};

class B : public A
{
    public :
        B(){
            ::std::cout << "B constructor.\n";
    }
    ~B()
    {
        ::std::cout << "B destructor.\n";
    }
};

class C
{
public:
    C()
    {
        ::std::cout << "C constructor.\n";
    }
    ~C()
    {
        ::std::cout << "C destructor.\n";
    }
};

int main()
{
    B b;
    C c;
}